Skip to content

fix(uxcore): Bob on Windrunner, sign in on Windrunner with a KeepSimple account - #263

Merged
manager merged 4 commits into
mainfrom
fix/bob-windrunner-sso
Dec 6, 2026
Merged

manager merged 4 commits into
mainfrom
fix/bob-windrunner-sso

Conversation

@manager

@manager manager commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

Bob moves off OpenAI custom GPTs, which close on 11 December, to windrunner.si/bob. KeepSimple accounts can now sign in on Windrunner.

  • Bob links in the homepage tools card, UX Core header and switcher, and the UXCat result page point to https://windrunner.si/bob.
  • /sso/windrunner reads the visitor's existing session and has Strapi confirm it. It then returns the visitor to the Windrunner callback with a short-lived Ed25519-signed assertion carried in the URL fragment. A visitor without a session gets the usual sign-in modal.
  • The existing sign-in code is unchanged. The only session change is the app's existing rule: a token Strapi refuses with 401 is dropped.
  • Two independent review rounds; findings in the new code are fixed.
  • Needs WINDRUNNER_SSO_PRIVATE_KEY in the runtime env. It is already present on prod and staging.

Authorized for production by the owner on 2026-12-06.

🤖 Generated with Claude Code

manager and others added 4 commits December 6, 2026 10:00
OpenAI retires custom GPTs on 11 December; Bob now lives on Windrunner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/sso/windrunner reads the visitor's existing KeepSimple session, has Strapi
confirm it, and returns them to the Windrunner callback with an Ed25519-signed
assertion (120 s, single nonce, aud windrunner.si). Visitors without a session
get the usual sign-in modal and come back through the redirect cookie. The
existing sign-in flow and stored sessions are untouched. Each request leaves
one JSON log line with a hashed account id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- An outage at Strapi no longer reads as a refused session.
- A refused token is dropped the way the rest of the app drops it, so the
  sign-in that follows does not stall on the auth page.
- Every failure leaves the loading screen: to the Windrunner callback when
  the server names it, back in history otherwise.
- Late answers after the visitor left the page are ignored.
- Closing the sign-in clears the return cookie; the cookie outlives an
  emailed sign-in link.
- The assertion travels in the URL fragment, out of access logs.
- email_verified only for Google and email-link sign-ins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Only a Strapi 401 counts as a refused session; a 403 from a proxy or rule
  can no longer sign a visitor out.
- The same-origin check compares against the host the request was served
  on, so it holds on every environment.
- An account switch in another tab during the check restarts the check
  instead of vouching for the previous account.
- A network failure in a tab with no history returns to the Windrunner
  callback instead of staying on the loading screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Dec 6, 2026 •

Copy link
Copy Markdown

Claude finished @manager's task in 27s —— View job


PR review: Bob on Windrunner and Windrunner SSO

  • Read the diff and the new SSO files
  • Post inline comments
  • Write summary

Assessment

The SSO bridge looks sound. I found no blocking issues. I read the code only. I did not run the app, the lint or any tests.

What looks good

  • The API route is POST-only and checks the same origin. It validates state against a strict pattern.
  • Strapi confirms the session before anything is signed. Only a 401 reads as a bad session. Any other failure, such as a 403 or a timeout, becomes a 502, so an outage never signs anyone out.
  • The assertion is Ed25519-signed with a 120s TTL and a jti. It binds aud to the callback origin and uses state as the nonce. It travels in the URL fragment, so it stays out of access logs.
  • email_verified is true only for providers that prove control of the address.
  • The callback must be https. The private key stays server-side and is validated as ed25519.
  • The Cache-Control: no-store header is set. The page is noindex. The effect cancels cleanly and handles an account switch in another tab.

Inline comments

  1. TestResultLayout.tsx: the import block was reshuffled, with third-party imports now after the @uxcore/* aliases. That breaks the repo's import order and adds noise. Please revert it so only the bobUrl line changes.
  2. windrunnerToken.ts: the truncated, unsalted SHA-256 of a sequential user id is easy to reverse, so the log comment overstates the privacy. Salt it with an HMAC or soften the claim. This is a nit.
  3. windrunner.tsx: router.back() on modal dismiss can strand the visitor, and Windrunner never hears about it. Consider returning to the callback with access_denied. This is a nit.

Other notes

  • The Windrunner callback URL is hardcoded as a fallback in both windrunnerToken.ts and windrunner.tsx. Keeping the two in sync is a small maintenance risk.
  • The same Bob URL is repeated in four places (OurTools, PageSwitcher, navItems, TestResultLayout). A shared constant in @constants would be cleaner. This is optional.
  • I did not check Windrunner's side of the key pinning or the WINDRUNNER_SSO_PRIVATE_KEY setup. The PR says the key is already in the prod and staging env.

import Image from 'next/image';
import { useRouter } from 'next/router';
import React, { FC, useContext, useEffect, useState } from 'react';
import Skeleton from 'react-loading-skeleton';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hunk reshuffles the whole import block and puts third-party packages (classnames, next/*, react) after the @uxcore/* aliases. That's the opposite of the repo's import order, and it looks like an unintended auto-sort. The PR only needs the bobUrl change, so please restore the original import block to keep the diff focused.

why: entry.why,
status: entry.status,
user: entry.sub
? createHash('sha256').update(entry.sub).digest('hex').slice(0, 12)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the comment says hashing means the log "never names a person", but a truncated unsalted SHA-256 of a small sequential integer id is trivially reversible by enumeration. Either salt it (HMAC with a server secret) or soften the claim.

setShowLogIn(show);
if (!show) {
deleteRedirectCookie();
router.back();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: router.back() when the visitor dismisses the sign-in modal can navigate off-site or do nothing if they landed here directly from Windrunner (no useful history). Consider sending them back to the Windrunner callback with error=access_denied&state=…, so the Windrunner side doesn't hang waiting on a login.

@manager
manager merged commit 83e4397 into main Dec 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant